Repository navigation
fix(awk): bound field operand recursion - #2693
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | bac76a8 | Commit Preview URL Branch Preview URL |
Oct 11 2026, 11:34 PM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
AWK field operands now charge unary
-,+, and!recursion against the same 100-level parser-depth budget as other recursive expressions. Over-limit programs fail with a bounded syntax diagnostic, while valid finite field expressions keep GNU Awk-compatible behavior.The regression suite runs hostile inline and VFS
awk -fprograms in a supervised child process with CPU, stack, wall-time, and output limits, plus an address-space limit on Linux. It also verifies boundary behavior, malformed input recovery, session reuse, and finite-expression parity with GNU Awk when available.Why
Unary chains beneath AWK's
$field operator bypassed the parser depth guard. Untrusted programs could recurse on the native stack instead of being rejected by the configured parser limit.Before / After
Before: a 200-operator field operand such as
$!!!!!!!!!!!!!!!!...1parsed successfully instead of reaching the depth limit; the new bounded regression failed with exit code 0.After: inline and
awk -fvariants using!,-,+, and mixed unary chains fail with exit code 2 andawk: fatal: expression nesting too deep (101 levels, max 100). The same session remains usable, and finite field operands match GNU Awk output and status.Validation:
just pre-pr;cargo bench -p bashkit --bench parallel_execution -- --noplot; bounded external production probe covering eight inline/file cases.Risk
Checklist